]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Don't shadow variables
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 20 Aug 2019 00:20:08 +0000 (02:20 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 11 Nov 2019 19:25:14 +0000 (19:25 +0000)
Having variables that share the same name in overlapping scopes is
confusing and error-prone, and is best avoided.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

34 files changed:
js/gdm/loginDialog.js
js/misc/ibusManager.js
js/misc/loginManager.js
js/misc/util.js
js/misc/weather.js
js/ui/appDisplay.js
js/ui/background.js
js/ui/backgroundMenu.js
js/ui/calendar.js
js/ui/components/automountManager.js
js/ui/components/autorunManager.js
js/ui/components/telepathyClient.js
js/ui/dash.js
js/ui/dnd.js
js/ui/extensionDownloader.js
js/ui/extensionSystem.js
js/ui/inhibitShortcutsDialog.js
js/ui/layout.js
js/ui/lookingGlass.js
js/ui/main.js
js/ui/notificationDaemon.js
js/ui/pointerA11yTimeout.js
js/ui/popupMenu.js
js/ui/runDialog.js
js/ui/screenShield.js
js/ui/screenshot.js
js/ui/status/accessibility.js
js/ui/status/keyboard.js
js/ui/status/network.js
js/ui/status/remoteAccess.js
js/ui/switcherPopup.js
js/ui/windowAttentionHandler.js
js/ui/windowManager.js
js/ui/workspaceThumbnail.js

index 74b239413df18c1bc38b9c9ccdf39535fc91bed6..e9cd564c88e4f69978362804d41d00392b7ac4ad 100644 (file)
@@ -984,7 +984,7 @@ var LoginDialog = GObject.registerClass({
         let hold = new Batch.Hold();
         let signalId = this._userList.connect('item-added',
             () => {
-                let item = this._userList.getItemFromUserName(userName);
+                item = this._userList.getItemFromUserName(userName);
 
                 if (item)
                     hold.release();
index e43f88c7ce22a207eda4d62a85d25329edcb6a7e..9b0aebb5f9e53ee1c5e46bf0aa6a6276ce3c4353 100644 (file)
@@ -157,10 +157,10 @@ var IBusManager = class {
             } catch (e) {
             }
             // If an engine is already active we need to get its properties
-            this._ibus.get_global_engine_async(-1, this._cancellable, (_bus, result) => {
+            this._ibus.get_global_engine_async(-1, this._cancellable, (_bus, res) => {
                 let engine;
                 try {
-                    engine = this._ibus.get_global_engine_async_finish(result);
+                    engine = this._ibus.get_global_engine_async_finish(res);
                     if (!engine)
                         return;
                 } catch (e) {
index f1ab2572f5ee06519c99834778a95731eb63a49d..bbcf0022c0684b2f67976835cbe57e5e7968a8ea 100644 (file)
@@ -110,14 +110,14 @@ var LoginManagerSystemd = class {
         let sessionId = GLib.getenv('XDG_SESSION_ID');
         if (!sessionId) {
             log('Unset XDG_SESSION_ID, getCurrentSessionProxy() called outside a user session. Asking logind directly.');
-            let [session, objectPath_] = this._userProxy.Display;
+            let [session, objectPath] = this._userProxy.Display;
             if (session) {
                 log(`Will monitor session ${session}`);
                 sessionId = session;
             } else {
                 log('Failed to find "Display" session; are we the greeter?');
 
-                for (let [session, objectPath] of this._userProxy.Sessions) {
+                for ([session, objectPath] of this._userProxy.Sessions) {
                     let sessionProxy = new SystemdLoginSession(Gio.DBus.system,
                                                                'org.freedesktop.login1',
                                                                objectPath);
index bdffffc529ca6b32eafb5a88870232be486f5ac1..7d5874bef3420a2f5facb6f5ced2ca0b6d2cc10b 100644 (file)
@@ -405,7 +405,7 @@ function ensureActorVisibleInScrollView(scrollView, actor) {
         if (!parent)
             throw new Error("actor not in scroll view");
 
-        let box = parent.get_allocation_box();
+        box = parent.get_allocation_box();
         y1 += box.y1;
         y2 += box.y1;
         parent = parent.get_parent();
index 51dd8acde895f02e0454231515d3cb2fd148fe27..b22cac17f15f0cea1f53b9e80677a5d389327f06 100644 (file)
@@ -47,11 +47,11 @@ var WeatherClient = class {
                 return;
             }
 
-            this._permStore.LookupRemote('gnome', 'geolocation', (res, error) => {
-                if (error)
-                    log(`Error looking up permission: ${error.message}`);
+            this._permStore.LookupRemote('gnome', 'geolocation', (res, err) => {
+                if (err)
+                    log(`Error looking up permission: ${err.message}`);
 
-                let [perms, data] = error ? [{}, null] : res;
+                let [perms, data] = err ? [{}, null] : res;
                 let  params = ['gnome', 'geolocation', false, data, perms];
                 this._onPermStoreChanged(this._permStore, '', params);
             });
index f205519591fa94a820612e4496f62d6198ca12fa..9193c121bed44d643fd17e2f83b32e4f85a989cf 100644 (file)
@@ -673,7 +673,7 @@ var AllView = GObject.registerClass({
 
     addFolderPopup(popup) {
         this._stack.add_actor(popup);
-        popup.connect('open-state-changed', (popup, isOpen) => {
+        popup.connect('open-state-changed', (o, isOpen) => {
             this._eventBlocker.reactive = isOpen;
 
             if (this._currentPopup) {
index b7b69482fd9d3e14aa0a4c045f6c0c82684d3796..9302cedea82094d30fb949cb59fa3f398d2ef7b4 100644 (file)
@@ -145,7 +145,7 @@ var BackgroundCache = class BackgroundCache {
 
         let monitor = file.monitor(Gio.FileMonitorFlags.NONE, null);
         monitor.connect('changed',
-                        (obj, file, otherFile, eventType) => {
+                        (obj, theFile, otherFile, eventType) => {
                             // Ignore CHANGED and CREATED events, since in both cases
                             // we'll get a CHANGES_DONE_HINT event when done.
                             if (eventType != Gio.FileMonitorEvent.CHANGED &&
index ec39d1290b606adf2becc937291b8c611703dfe2..33e9416cbd55e74d82c0794cfb266406cc2406be 100644 (file)
@@ -35,7 +35,7 @@ function addBackgroundMenu(actor, layoutManager) {
     }
 
     let clickAction = new Clutter.ClickAction();
-    clickAction.connect('long-press', (action, actor, state) => {
+    clickAction.connect('long-press', (action, theActor, state) => {
         if (state == Clutter.LongPressState.QUERY)
             return ((action.get_button() == 0 ||
                      action.get_button() == 1) &&
index 03611a3abd5a9b6106a6ba582efac617ae6cf567..40d49cc6ba636bfd7f59cfe7297fe2611f2270c0 100644 (file)
@@ -996,7 +996,7 @@ class NotificationSection extends MessageList.MessageListSection {
             notificationAddedId: 0,
         };
 
-        obj.destroyId = source.connect('destroy', source => {
+        obj.destroyId = source.connect('destroy', () => {
             this._onSourceDestroy(source, obj);
         });
         obj.notificationAddedId = source.connect('notification-added',
@@ -1170,7 +1170,7 @@ class CalendarMessageList extends St.Widget {
             Util.ensureActorVisibleInScrollView(this._scrollView, messageActor);
         }));
 
-        connectionsIds.push(section.connect('destroy', (section) => {
+        connectionsIds.push(section.connect('destroy', () => {
             connectionsIds.forEach(id => section.disconnect(id));
             this._sectionList.remove_actor(section);
         }));
index 6d46a1e23d19c315a73da872cf2586d592c65451..467829f73597a43870cc34194cef9aafbaaa956a 100644 (file)
@@ -109,7 +109,7 @@ var AutomountManager = class {
         // mount operation object
         if (drive.can_stop()) {
             drive.stop(Gio.MountUnmountFlags.FORCE, null, null,
-                (drive, res) => {
+                (o, res) => {
                     try {
                         drive.stop_finish(res);
                     } catch (e) {
@@ -118,7 +118,7 @@ var AutomountManager = class {
                 });
         } else if (drive.can_eject()) {
             drive.eject_with_operation(Gio.MountUnmountFlags.FORCE, null, null,
-                (drive, res) => {
+                (o, res) => {
                     try {
                         drive.eject_with_operation_finish(res);
                     } catch (e) {
index 222d34751dbbe06147baef809367c601e2118a53..cf5acb83c48df1618cc11b124688f1838613f6c8 100644 (file)
@@ -115,7 +115,8 @@ var ContentTypeDiscoverer = class {
 
             let hotplugSniffer = new HotplugSniffer();
             hotplugSniffer.SniffURIRemote(root.get_uri(),
-                ([contentTypes]) => {
+                result => {
+                    [contentTypes] = result;
                     this._emitCallback(mount, contentTypes);
                 });
         }
@@ -166,7 +167,7 @@ var AutorunManager = class {
         if (!this._session.SessionIsActive)
             return;
 
-        let discoverer = new ContentTypeDiscoverer((mount, apps, contentTypes) => {
+        let discoverer = new ContentTypeDiscoverer((m, apps, contentTypes) => {
             this._dispatcher.addMount(mount, apps, contentTypes);
         });
         discoverer.guessContentTypes(mount);
index 68d4f53ab22cc94df8d4fa42da0562d2a299f357..75ccb897ac711e21864b23894fe32acdc348d30b 100644 (file)
@@ -248,7 +248,7 @@ class TelepathyClient extends Tp.BaseClient {
         }
 
         // Approve private text channels right away as we are going to handle it
-        dispatchOp.claim_with_async(this, (dispatchOp, result) => {
+        dispatchOp.claim_with_async(this, (o, result) => {
             try {
                 dispatchOp.claim_with_finish(result);
                 this._handlingChannels(account, conn, [channel], false);
index 4b72ec4087b7a6a85e640ce8ac9e0cb27dacf41c..17b864ed89f34a412e49916f75b1879a890deea0 100644 (file)
@@ -481,7 +481,7 @@ var Dash = GObject.registerClass({
         let appIcon = new DashIcon(app);
 
         appIcon.connect('menu-state-changed',
-                        (appIcon, opened) => {
+                        (o, opened) => {
                             this._itemMenuStateChanged(item, opened);
                         });
 
index 30da86be63eaf8a837d4f23d96a733f900e78dac..d9abb04505565b90ca9e9a4918036d2af0068bc9 100644 (file)
@@ -155,7 +155,7 @@ var _Draggable = class _Draggable {
         this._grabbedDevice = pointer;
         this._touchSequence = touchSequence;
 
-        this._capturedEventId = global.stage.connect('captured-event', (actor, event) => {
+        this._capturedEventId = global.stage.connect('captured-event', (o, event) => {
             let device = event.get_device();
             if (device != this._grabbedDevice &&
                 device.get_device_type() != Clutter.InputDeviceType.KEYBOARD_DEVICE)
index a19aa832be7b86c975088a77f6230b3d5d73baa9..4cf0414ddfa2ba0be362359dbe77552e5a1905f6 100644 (file)
@@ -24,7 +24,7 @@ function installExtension(uuid, invocation) {
 
     let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params);
 
-    _httpSession.queue_message(message, (session, message) => {
+    _httpSession.queue_message(message, () => {
         if (message.status_code != Soup.KnownStatusCode.OK) {
             Main.extensionManager.logExtensionError(uuid, `downloading info: ${message.status_code}`);
             invocation.return_dbus_error('org.gnome.Shell.DownloadInfoError', message.status_code.toString());
@@ -90,7 +90,7 @@ function gotExtensionZipFile(session, message, uuid, dir, callback, errback) {
         return;
     }
 
-    GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, (pid, status) => {
+    GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, (o, status) => {
         GLib.spawn_close_pid(pid);
 
         if (status != 0)
@@ -113,7 +113,7 @@ function updateExtension(uuid) {
     let url = REPOSITORY_URL_DOWNLOAD.format(uuid);
     let message = Soup.form_request_new_from_hash('GET', url, params);
 
-    _httpSession.queue_message(message, (session, message) => {
+    _httpSession.queue_message(message, session => {
         gotExtensionZipFile(session, message, uuid, newExtensionTmpDir, () => {
             let oldExtension = Main.extensionManager.lookup(uuid);
             let extensionDir = oldExtension.dir;
@@ -145,8 +145,8 @@ function updateExtension(uuid) {
             }
 
             FileUtils.recursivelyDeleteDir(oldExtensionTmpDir, true);
-        }, (code, message) => {
-            log('Error while updating extension %s: %s (%s)'.format(uuid, code, message ? message : ''));
+        }, (code, msg) => {
+            log(`Error while updating extension ${uuid}: ${code} (${msg})`);
         });
     });
 }
@@ -162,7 +162,7 @@ function checkForUpdates() {
 
     let url = REPOSITORY_URL_UPDATE;
     let message = Soup.form_request_new_from_hash('GET', url, params);
-    _httpSession.queue_message(message, (session, message) => {
+    _httpSession.queue_message(message, () => {
         if (message.status_code != Soup.KnownStatusCode.OK)
             return;
 
@@ -220,10 +220,9 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
         let uuid = this._uuid;
         let dir = Gio.File.new_for_path(GLib.build_filenamev([global.userdatadir, 'extensions', uuid]));
         let invocation = this._invocation;
-        function errback(code, message) {
-            let msg = message ? message.toString() : '';
-            log('Error while installing %s: %s (%s)'.format(uuid, code, msg));
-            invocation.return_dbus_error(`org.gnome.Shell.${code}`, msg);
+        function errback(code, msg) {
+            log(`Error while installing ${uuid}: ${code} (${msg})`);
+            invocation.return_dbus_error(`org.gnome.Shell.${code}`, msg || '');
         }
 
         function callback() {
@@ -241,7 +240,7 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
             invocation.return_value(GLib.Variant.new('(s)', ['successful']));
         }
 
-        _httpSession.queue_message(message, (session, message) => {
+        _httpSession.queue_message(message, session => {
             gotExtensionZipFile(session, message, uuid, dir, callback, errback);
         });
 
index 87ea221f9c1f9a3c2c08da7fcebacff3c22a0ad6..b58d4f580ed91a2aa0dd5d1e574aa765bd011578 100644 (file)
@@ -60,11 +60,11 @@ var ExtensionManager = class {
         let orderReversed = order.slice().reverse();
 
         for (let i = 0; i < orderReversed.length; i++) {
-            let uuid = orderReversed[i];
+            let otherUuid = orderReversed[i];
             try {
-                this.lookup(uuid).stateObj.disable();
+                this.lookup(otherUuid).stateObj.disable();
             } catch (e) {
-                this.logExtensionError(uuid, e);
+                this.logExtensionError(otherUuid, e);
             }
         }
 
@@ -81,11 +81,11 @@ var ExtensionManager = class {
         }
 
         for (let i = 0; i < order.length; i++) {
-            let uuid = order[i];
+            let otherUuid = order[i];
             try {
-                this.lookup(uuid).stateObj.enable();
+                this.lookup(otherUuid).stateObj.enable();
             } catch (e) {
-                this.logExtensionError(uuid, e);
+                this.logExtensionError(otherUuid, e);
             }
         }
 
index 76960e2336537b9f7669397dc4918f6c26967e66..24699cff05ad7d156560132626c65076dc853c9b 100644 (file)
@@ -134,10 +134,10 @@ var InhibitShortcutsDialog = GObject.registerClass({
 
             this._permStore.LookupRemote(APP_PERMISSIONS_TABLE,
                                          APP_PERMISSIONS_ID,
-                (res, error) => {
-                    if (error) {
+                (res, err) => {
+                    if (err) {
                         this._dialog.open();
-                        log(error.message);
+                        log(err.message);
                         return;
                     }
 
index 6729f87c406d3df7b23331179f4d284bab633159..ab3d6deb0c140d4adc7395452995cdc4df77a888 100644 (file)
@@ -469,8 +469,7 @@ var LayoutManager = GObject.registerClass({
     }
 
     _updateBackgrounds() {
-        let i;
-        for (i = 0; i < this._bgManagers.length; i++)
+        for (let i = 0; i < this._bgManagers.length; i++)
             this._bgManagers[i].destroy();
 
         this._bgManagers = [];
index 8a8675fd291580d7478ec3daf1bee2027422defe..184cafc0cee94338ba2015a0ca1b03129d4b9b19 100644 (file)
@@ -423,10 +423,10 @@ class ObjInspector extends St.ScrollView {
                 } catch (e) {
                     link = new St.Label({ text: '<error>' });
                 }
-                let hbox = new St.BoxLayout();
-                hbox.add(new St.Label({ text: `${propName}: ` }));
-                hbox.add(link);
-                this._container.add_actor(hbox);
+                let box = new St.BoxLayout();
+                box.add(new St.Label({ text: `${propName}: ` }));
+                box.add(link);
+                this._container.add_actor(box);
             }
         }
     }
index 454b155b9ca12d11a78a030384ba8697bae5a0b7..ff564027edf00f04a9d658d1b9dc444a18c27c27 100644 (file)
@@ -296,7 +296,7 @@ function _getStylesheet(name) {
     let dataDirs = GLib.get_system_data_dirs();
     for (let i = 0; i < dataDirs.length; i++) {
         let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]);
-        let stylesheet = Gio.file_new_for_path(path);
+        stylesheet = Gio.file_new_for_path(path);
         if (stylesheet.query_exists(null))
             return stylesheet;
     }
index a5dd2ada23a07f391abdb36587946ef88da545de..d9be574a562dddcab18a0a331542b837c14bedea 100644 (file)
@@ -245,7 +245,7 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
                 return;
             }
 
-            let [pid] = result;
+            [pid] = result;
             source = this._getSource(appName, pid, ndata, sender, null);
 
             this._senderToPid[sender] = pid;
index 516dcf039c5b621e74506f474d6e1626e4e0dc31..20233d43fe2aecaf4acc6e7a58941aa772b7284d 100644 (file)
@@ -110,7 +110,7 @@ var PointerA11yTimeout = class PointerA11yTimeout {
     constructor() {
         let manager = Clutter.DeviceManager.get_default();
 
-        manager.connect('ptr-a11y-timeout-started', (manager, device, type, timeout) => {
+        manager.connect('ptr-a11y-timeout-started', (o, device, type, timeout) => {
             let [x, y] = global.get_pointer();
 
             this._pieTimer = new PieTimer();
@@ -123,7 +123,7 @@ var PointerA11yTimeout = class PointerA11yTimeout {
                 global.display.set_cursor(Meta.Cursor.CROSSHAIR);
         });
 
-        manager.connect('ptr-a11y-timeout-stopped', (manager, device, type, clicked) => {
+        manager.connect('ptr-a11y-timeout-stopped', (o, device, type, clicked) => {
             if (!clicked)
                 this._pieTimer.destroy();
 
index c168e00dc143bc53b1c556bf6cafc208bcbc4e8c..1a5b90d5cfcea18236e5bfc75a440d061c2df0e7 100644 (file)
@@ -507,7 +507,7 @@ var PopupMenuBase = class {
             menuItem = new PopupMenuItem(title);
 
         this.addMenuItem(menuItem);
-        menuItem.connect('activate', (menuItem, event) => {
+        menuItem.connect('activate', (o, event) => {
             callback(event);
         });
 
@@ -565,7 +565,7 @@ var PopupMenuBase = class {
     }
 
     _connectItemSignals(menuItem) {
-        menuItem._activeChangeId = menuItem.connect('notify::active', menuItem => {
+        menuItem._activeChangeId = menuItem.connect('notify::active', () => {
             let active = menuItem.active;
             if (active && this._activeMenuItem != menuItem) {
                 if (this._activeMenuItem)
@@ -589,7 +589,7 @@ var PopupMenuBase = class {
                     menuItem.actor.grab_key_focus();
             }
         });
-        menuItem._activateId = menuItem.connect_after('activate', (menuItem, _event) => {
+        menuItem._activateId = menuItem.connect_after('activate', () => {
             this.emit('activate', menuItem);
             this.itemActivated(BoxPointer.PopupAnimation.FULL);
         });
@@ -602,7 +602,7 @@ var PopupMenuBase = class {
         // the menuItem may have, called destroyId
         // (FIXME: in the future it may make sense to have container objects
         // like PopupMenuManager does)
-        menuItem._popupMenuDestroyId = menuItem.connect('destroy', menuItem => {
+        menuItem._popupMenuDestroyId = menuItem.connect('destroy', () => {
             menuItem.disconnect(menuItem._popupMenuDestroyId);
             menuItem.disconnect(menuItem._activateId);
             menuItem.disconnect(menuItem._activeChangeId);
index 8ba0404b49eda9342790979a6959a70967549ef4..2881ec2d98d5e98699e20966822289bba2da0b57 100644 (file)
@@ -217,12 +217,12 @@ class RunDialog extends ModalDialog.ModalDialog {
                     try {
                         Gio.app_info_launch_default_for_uri(file.get_uri(),
                                                             global.create_app_launch_context(0, -1));
-                    } catch (e) {
+                    } catch (err) {
                         // The exception from gjs contains an error string like:
                         //     Error invoking Gio.app_info_launch_default_for_uri: No application
                         //     is registered as handling this file
                         // We are only interested in the part after the first colon.
-                        let message = e.message.replace(/[^:]*: *(.+)/, '$1');
+                        let message = err.message.replace(/[^:]*: *(.+)/, '$1');
                         this._showError(message);
                     }
                 } else {
index c96003acd48ef1c11fdcdf65e3371641f030cb60..732bb69a4fc92ae6b723ac42d2ff0ec8489d7ab0 100644 (file)
@@ -230,10 +230,10 @@ var NotificationsBox = GObject.registerClass({
         this._showSource(source, obj, obj.sourceBox);
         this._notificationBox.add_child(obj.sourceBox);
 
-        obj.sourceCountChangedId = source.connect('notify::count', source => {
+        obj.sourceCountChangedId = source.connect('notify::count', () => {
             this._countChanged(source, obj);
         });
-        obj.sourceTitleChangedId = source.connect('notify::title', source => {
+        obj.sourceTitleChangedId = source.connect('notify::title', () => {
             this._titleChanged(source, obj);
         });
         obj.policyChangedId = source.policy.connect('notify', (policy, pspec) => {
@@ -242,7 +242,7 @@ var NotificationsBox = GObject.registerClass({
             else
                 this._detailedChanged(source, obj);
         });
-        obj.sourceDestroyId = source.connect('destroy', source => {
+        obj.sourceDestroyId = source.connect('destroy', () => {
             this._onSourceDestroy(source, obj);
         });
 
index 11f8afa445f92d5245251aab5e683403cfff96da..08133dbfb25769ba5b12a68c5e39cb1a51fe166a 100644 (file)
@@ -230,7 +230,7 @@ var ScreenshotService = class {
     SelectAreaAsync(params, invocation) {
         let selectArea = new SelectArea();
         selectArea.show();
-        selectArea.connect('finished', (selectArea, areaRectangle) => {
+        selectArea.connect('finished', (o, areaRectangle) => {
             if (areaRectangle) {
                 let retRectangle = this._unscaleArea(areaRectangle.x, areaRectangle.y,
                                                      areaRectangle.width, areaRectangle.height);
@@ -260,7 +260,7 @@ var ScreenshotService = class {
     PickColorAsync(params, invocation) {
         let pickPixel = new PickPixel();
         pickPixel.show();
-        pickPixel.connect('finished', (pickPixel, coords) => {
+        pickPixel.connect('finished', (obj, coords) => {
             if (coords) {
                 let screenshot = this._createScreenshot(invocation, false);
                 if (!screenshot)
index b323b4f419b583ada7e9c4d0e09f3c757020c99c..6ac7233a1bd935f977eccfd0f7f33a4a053d8c95 100644 (file)
@@ -186,7 +186,7 @@ class ATIndicator extends PanelMenu.Button {
             });
 
         settings.connect(`changed::${KEY_TEXT_SCALING_FACTOR}`, () => {
-            let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
+            factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
             let active = (factor > 1.0);
             widget.setToggleState(active);
 
index d6423e5ab5897883f7cf711792a2f978ef4014c3..1591c315677dcb840fd610c05b03bbce9aee1236 100644 (file)
@@ -986,16 +986,16 @@ class InputSourceIndicator extends PanelMenu.Button {
                         return;
 
                     let group = item.radioGroup;
-                    for (let i = 0; i < group.length; ++i) {
-                        if (group[i] == item) {
+                    for (let j = 0; j < group.length; ++j) {
+                        if (group[j] == item) {
                             item.setOrnament(PopupMenu.Ornament.DOT);
                             item.prop.set_state(IBus.PropState.CHECKED);
                             ibusManager.activateProperty(item.prop.get_key(),
                                                          IBus.PropState.CHECKED);
                         } else {
-                            group[i].setOrnament(PopupMenu.Ornament.NONE);
-                            group[i].prop.set_state(IBus.PropState.UNCHECKED);
-                            ibusManager.activateProperty(group[i].prop.get_key(),
+                            group[j].setOrnament(PopupMenu.Ornament.NONE);
+                            group[j].prop.set_state(IBus.PropState.UNCHECKED);
+                            ibusManager.activateProperty(group[j].prop.get_key(),
                                                          IBus.PropState.UNCHECKED);
                         }
                     }
index 753f3e56398a254128d8712a13ce24e23f622240..ed5f4cd135d7294e2d400901b1bbd2c59b10ad09 100644 (file)
@@ -271,7 +271,7 @@ var NMConnectionSection = class NMConnectionSection {
             return;
 
         item.connect('icon-changed', () => this._iconChanged());
-        item.connect('activation-failed', (item, reason) => {
+        item.connect('activation-failed', (o, reason) => {
             this.emit('activation-failed', reason);
         });
         item.connect('name-changed', this._sync.bind(this));
@@ -1987,9 +1987,9 @@ class Indicator extends PanelMenu.SystemIndicator {
         } else if (result == PortalHelperResult.COMPLETED) {
             this._closeConnectivityCheck(path);
         } else if (result == PortalHelperResult.RECHECK) {
-            this._client.check_connectivity_async(null, (client, result) => {
+            this._client.check_connectivity_async(null, (client, res) => {
                 try {
-                    let state = client.check_connectivity_finish(result);
+                    let state = client.check_connectivity_finish(res);
                     if (state >= NM.ConnectivityState.FULL)
                         this._closeConnectivityCheck(path);
                 } catch (e) { }
index 0e13c04cf4e750c1499e370baac2edb1e05a5e3d..0bacb73db1befbd42c52840d6ad9f619736be153 100644 (file)
@@ -28,7 +28,7 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator {
         this._indicator = null;
         this._menuSection = null;
 
-        controller.connect('new-handle', (controller, handle) => {
+        controller.connect('new-handle', (o, handle) => {
             this._onNewHandle(handle);
         });
     }
index 04c4d3337efa9be1b4f6bf061be1e361ac48e2d7..e2b6cca4adef15a8a92db994ac926a5a3b0f1d5b 100644 (file)
@@ -509,7 +509,7 @@ var SwitcherList = GObject.registerClass({
             maxChildNat = Math.max(childNat, maxChildNat);
 
             if (this._squareItems) {
-                let [childMin, childNat] = this._items[i].get_preferred_height(-1);
+                [childMin, childNat] = this._items[i].get_preferred_height(-1);
                 maxChildMin = Math.max(childMin, maxChildMin);
                 maxChildNat = Math.max(childNat, maxChildNat);
             }
index 650bca4986301817002dd599b74cc6fd2d5bbe4b..f95ce4bc768623d57121a0b6d750dab597ef2a09 100644 (file)
@@ -48,7 +48,7 @@ var WindowAttentionHandler = class {
         source.showNotification(notification);
 
         source.signalIDs.push(window.connect('notify::title', () => {
-            let [title, banner] = this._getTitleAndBanner(app, window);
+            [title, banner] = this._getTitleAndBanner(app, window);
             notification.update(title, banner);
         }));
     }
index 382e6c7de1c6bb4445b90a0ac0e1918177349c9d..e37c7fc224fab70b051724a18d8793296b0f147c 100644 (file)
@@ -30,7 +30,8 @@ var WINDOW_ANIMATION_TIME = 250;
 var DIM_BRIGHTNESS = -0.3;
 var DIM_TIME = 500;
 var UNDIM_TIME = 250;
-var MOTION_THRESHOLD = 100;
+var WS_MOTION_THRESHOLD = 100;
+var APP_MOTION_THRESHOLD = 30;
 
 var ONE_SECOND = 1000; // in ms
 
@@ -493,13 +494,13 @@ var TouchpadWorkspaceSwitchAction = class {
     _checkActivated() {
         let dir;
 
-        if (this._dy < -MOTION_THRESHOLD)
+        if (this._dy < -WS_MOTION_THRESHOLD)
             dir = Meta.MotionDirection.DOWN;
-        else if (this._dy > MOTION_THRESHOLD)
+        else if (this._dy > WS_MOTION_THRESHOLD)
             dir = Meta.MotionDirection.UP;
-        else if (this._dx < -MOTION_THRESHOLD)
+        else if (this._dx < -WS_MOTION_THRESHOLD)
             dir = Meta.MotionDirection.RIGHT;
-        else if (this._dx > MOTION_THRESHOLD)
+        else if (this._dx > WS_MOTION_THRESHOLD)
             dir = Meta.MotionDirection.LEFT;
         else
             return false;
@@ -586,8 +587,8 @@ var WorkspaceSwitchAction = GObject.registerClass({
     vfunc_swipe(actor, direction) {
         let [x, y] = this.get_motion_coords(0);
         let [xPress, yPress] = this.get_press_coords(0);
-        if (Math.abs(x - xPress) < MOTION_THRESHOLD &&
-            Math.abs(y - yPress) < MOTION_THRESHOLD) {
+        if (Math.abs(x - xPress) < WS_MOTION_THRESHOLD &&
+            Math.abs(y - yPress) < WS_MOTION_THRESHOLD) {
             this.emit('cancel');
             return;
         }
@@ -654,15 +655,14 @@ var AppSwitchAction = GObject.registerClass({
     }
 
     vfunc_gesture_progress(_actor) {
-        const MOTION_THRESHOLD = 30;
 
         if (this.get_n_current_points() == 3) {
             for (let i = 0; i < this.get_n_current_points(); i++) {
                 let [startX, startY] = this.get_press_coords(i);
                 let [x, y] = this.get_motion_coords(i);
 
-                if (Math.abs(x - startX) > MOTION_THRESHOLD ||
-                    Math.abs(y - startY) > MOTION_THRESHOLD)
+                if (Math.abs(x - startX) > APP_MOTION_THRESHOLD ||
+                    Math.abs(y - startY) > APP_MOTION_THRESHOLD)
                     return false;
             }
 
index edcf54303ec170993e0ba3abfdbe7aa9be567d15..397f52140331c906068c50331c9aec1ed99a7ead 100644 (file)
@@ -508,7 +508,7 @@ var WorkspaceThumbnail = GObject.registerClass({
     _addWindowClone(win) {
         let clone = new WindowClone(win);
 
-        clone.connect('selected', (clone, time) => {
+        clone.connect('selected', (o, time) => {
             this.activate(time);
         });
         clone.connect('drag-begin', () => {